package com.ruoyi.web.controller.common;

import com.ruoyi.system.domain.vo.Student;
import com.ruoyi.system.service.impl.StudentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/students")
public class StudentController {
    @Autowired
    private StudentServiceImpl studentServiceimpl;
    //添加
    @PostMapping("/add")
    public String addStudent(@RequestBody Student student) {
        String add = studentServiceimpl.add(student);
        return add;
    }
    //查询
    @PostMapping("/select")
    public List<Student> selectStudent(@RequestBody Student student) {
        return studentServiceimpl.select(student);

    }

}
